<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/IC_Driver/SPI_WB25Qxx.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_27151ef53f10301e424ca52b7f0da996.html">IC_Driver</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">SPI_WB25Qxx.c</div></div>
</div><!--header-->
<div class="contents">
<a href="_s_p_i___w_b25_qxx_8c.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#include &quot;<a class="code" href="_s_p_i___w_b25_qxx_8h.html">SPI_WB25Qxx.h</a>&quot;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#include &quot;SWM341.h&quot;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#include &quot;<a class="code" href="dev__io__spi_8h.html">dev_io_spi.h</a>&quot;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="comment"> * Private Define</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="comment">/* SPI Flash Operation Mode enum */</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a0161e7adc88bedc3fb18049e4df8a848">   31</a></span><span class="preprocessor">#define Standard_SPI    0   </span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ad2006b83eb68839aba4170b0ecd78426">   32</a></span><span class="preprocessor">#define Dual_SPI        1   </span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#aae99f253a33d9a3b6b5664af072cb6b3">   33</a></span><span class="preprocessor">#define Quad_SPI        2   </span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a649ee33974abe97f0eda5a2e00c6e2d7">   34</a></span><span class="preprocessor">#define QPI             3   </span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a25b574a296f6b3ce3671990801bc6ee8">   40</a></span><span class="preprocessor">#define SPI_FLASH_MODE          Quad_SPI</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span><span class="comment"> * Register Parameter </span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">   45</a></span><span class="preprocessor">#define DUMMY_CLOCK                 0xFF</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">   46</a></span><span class="preprocessor">#define WB25Qxx_A_PAGE_BYTES        (256)</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a6963996b0b5cfabd2f20a5c7ef915a6b">   47</a></span><span class="preprocessor">#define WB25Qxx_MANUFACTOR_ID       0xEF</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a898d70676b1ca77b7990d4b8d17b9e9b">   48</a></span><span class="preprocessor">#define WB25Qxx_DEVICE_ID           0x17</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ab1a5569183970e41016b5e01748bca43">   49</a></span><span class="preprocessor">#define WB25Qxx_JEDEC_ID            0x4018</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span><span class="comment">/* Manufacturer and Device Identification</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span><span class="comment"> * MANUFACTURER ID          (MF7 - MF0)</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span><span class="comment"> * Winbond Serial Flash     EFh</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span><span class="comment"> *</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span><span class="comment"> * Device ID                (ID7 - ID0)             (ID15 - ID0)</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span><span class="comment"> * Instruction              ABh, 90h, 92h, 94h      9Fh</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span><span class="comment"> * W25Q128FV (SPI Mode)     17h                     4018h</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span><span class="comment"> * W25Q128FV (QPI Mode)     17h                     6018h</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span><span class="comment"> */</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#aaa52d63c064c0876bbbac9ea72274ba0">   60</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_CHIP_ID        0x90</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a3e31bf242c5fe28610d2ff6abe212fec">   61</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_CHIP_ID_DUAL   0x92</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a4ef715c150bf0527ee6a893fca31154a">   62</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_CHIP_ID_QUAD   0x94</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#aa12851def6f4715c35406a35bacd6c03">   63</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_UNIQUE_ID      0x4B</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a7a29a7c5cd84c833994d75370d0a8f02">   64</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_JEDEC_ID       0x9F</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a10422a9a0e2f18409b44cd66b099f0f8">   65</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_SFDP           0x5A</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a4491f61ab80618ea07fcd79ebf46a38e">   67</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_STATUS_1       0x05</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a9b4d04305e7fab38b63926c818cfe608">   68</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_STATUS_2       0x35</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a769fffb916f36fa487b8b4231ef4c794">   69</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_STATUS_3       0x15</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a41f43e7631d713c3f96058444e57b90a">   71</a></span><span class="preprocessor">#define WB25Qxx_CMD_WRITE_STATUS_1      0x01</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#aee6643c146233d7cacb6ade01f6f7761">   72</a></span><span class="preprocessor">#define WB25Qxx_CMD_WRITE_STATUS_2      0x31</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ac367271cfae151ea76712d19ee7bfd53">   73</a></span><span class="preprocessor">#define WB25Qxx_CMD_WRITE_STATUS_3      0x11</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a01d01614cc724abc7846f5e40d98da05">   75</a></span><span class="preprocessor">#define WB25Qxx_STATUS_WIP_Pos      0       </span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a76dd4fc3eb8373980abf7a0a826a2171">   76</a></span><span class="preprocessor">#define WB25Qxx_STATUS_WIP_Msk      (0x01 &lt;&lt; WB25Qxx_STATUS_WIP_Pos)</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a2b55b2ba81edc4bea8febae8c8a0e730">   77</a></span><span class="preprocessor">#define WB25Qxx_STATUS_WEL_Pos      1       </span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ad3c49cc648561114de78f3323e7d6871">   78</a></span><span class="preprocessor">#define WB25Qxx_STATUS_WEL_Msk      (0x01 &lt;&lt; WB25Qxx_STATUS_WEL_Pos)</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a13aab32847f5eb10f230517d847cf5c6">   79</a></span><span class="preprocessor">#define WB25Qxx_STATUS_SBP_Pos      2       </span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a0d18ddd25946c7cf6d4fd5119a76b378">   80</a></span><span class="preprocessor">#define WB25Qxx_STATUS_SBP_Msk      (0x1F &lt;&lt; WB25Qxx_STATUS_SBP_Pos)</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#af5d4ac06fb940efebc7012005897eb44">   81</a></span><span class="preprocessor">#define WB25Qxx_STATUS_SRP_Pos      7       </span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a2ddf8b5c6c19b5384b78d848223dd521">   82</a></span><span class="preprocessor">#define WB25Qxx_STATUS_SRP_Msk      (0x03 &lt;&lt; WB25Qxx_STATUS_SRP_Pos)</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a4aaefb2b01e4d63ac527f0cd55003cf2">   83</a></span><span class="preprocessor">#define WB25Qxx_STATUS_QE_Pos       9       </span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#aa38cc8ee8d4b1126001e721d05247bfe">   84</a></span><span class="preprocessor">#define WB25Qxx_STATUS_QE_Msk       (0x01 &lt;&lt; WB25Qxx_STATUS_QE_Pos)</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a8b97f6b54a5ae43ca9e758acf36c81fa">   85</a></span><span class="preprocessor">#define WB25Qxx_STATUS_SUS_Pos      15      </span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a16ee1d9b0a8867d65240bd27deffc4db">   86</a></span><span class="preprocessor">#define WB25Qxx_STATIS_SUS_Msk      (0x01 &lt;&lt; WB25Qxx_STATUS_SUS_Pos)</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ab9d9c1f921d00b09bf3f6d533f36de32">   88</a></span><span class="preprocessor">#define WB25Qxx_CMD_READ_DATA               0x03 </span><span class="comment">/* Clock frequency for Read Data instruction (03h) : MAX = 50 MHz */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a8ab716dbcb2ebbe5cbb92676585eb5bc">   89</a></span><span class="preprocessor">#define WB25Qxx_CMD_FAST_READ_DATA          0x0B</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ac2d2b37501003e685f84924bcbe921a1">   90</a></span><span class="preprocessor">#define WB25Qxx_CMD_FAST_READ_DUAL_OUTPUT   0x3B</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a5aa55559be100d2f44e11c6e5370dcfb">   91</a></span><span class="preprocessor">#define WB25Qxx_CMD_FAST_READ_QUAD_OUTPUT   0x6B</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a338f007fb52bae972093705347e7ce0f">   92</a></span><span class="preprocessor">#define WB25Qxx_CMD_FAST_READ_DUAL_IO       0xBB</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a9b4b5c3946502ca9fbf4d1259efbadcf">   93</a></span><span class="preprocessor">#define WB25Qxx_CMD_FAST_READ_QUAD_IO       0xEB </span><span class="comment">/* Clock frequency for QPI Read instructions (0Bh,EBh, 0Ch), </span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#add8e47c7436ee8158d45cc2a9d34999b">   94</a></span><span class="comment">                                                  * with different dummy clocks : MAX = 33~104 MHz </span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a4040c3c8299573cd8222219eef655c44">   95</a></span><span class="comment">                                                  */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a7a17b081e5d51e64acc60324c53f2f3d">   96</a></span><span class="preprocessor">#define WB25Qxx_CMD_PROGRAM_PAGE          0x02</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#aab0e0f76dbe0f2080d4032f1d1585a79">   97</a></span><span class="preprocessor">#define WB25Qxx_CMD_PROGRAM_PAGE_QUAD     0x32 </span><span class="comment">/* The Quad Page Program can improve performance </span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ad64b98b9166da0475e194396bf07adc5">   98</a></span><span class="comment">                                                * for PROM Programmer and applications that have slow clock speeds &lt; 5 MHz.</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#aab55dad656088200776ab4d4bb560162">   99</a></span><span class="comment">                                                * Systems with faster clock speed will not realize much benefit for the Quad Page Program instruction </span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span><span class="comment">                                                * since the inherent page program time is much greater than the time it take to clock-in the data.</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ac09f7d91a3a83bb1b6a993dbab130583">  101</a></span><span class="comment">                                                */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a00f22b0b839f27dce381862c38789241">  102</a></span><span class="preprocessor">#define WB25Qxx_CMD_ERASE_SECTOR_4KB    0x20</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span><span class="preprocessor">#define WB25Qxx_CMD_ERASE_BLOCK_32KB    0x52</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span><span class="preprocessor">#define WB25Qxx_CMD_ERASE_BLOCK_64KB    0xD8</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span><span class="preprocessor">#define WB25Qxx_CMD_ERASE_CHIP          0xC7 </span><span class="comment">//or 0x60</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#af202e311e227e572f6a06817e6624ec6">  107</a></span><span class="preprocessor">#define WB25Qxx_CMD_WRITE_ENABLE    0x06</span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#acc1238cefaf02261c21cb7d46dc32bd5">  108</a></span><span class="preprocessor">#define WB25Qxx_CMD_WRITE_DISABLE   0x04</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a1b303c18ee9f1f7cced4ffae5815b1e6">  109</a></span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span><span class="comment">/* Clock frequency for all other SPI/QPI instructions</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a46a47506fa07fb76c91eba33c4300067">  111</a></span><span class="comment"> * 2.7V-3.6V VCC &amp; Industrial Temperature : MAX = 104 MHz</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#adaa8f59252c7b7e098e3db05a61d38bd">  112</a></span><span class="comment"> */</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span><span class="preprocessor">#define WB25Qxx_CMD_ENTER_QPI       0x38</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span><span class="preprocessor">#define WB25Qxx_CMD_EXIT_QPI        0xFF</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span><span class="preprocessor">#define WB25Qxx_CMD_SET_READ_PARAM  0xC0</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span> </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span><span class="preprocessor">#define WB25Qxx_CMD_POWER_DOWN              0xB9 </span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span><span class="preprocessor">#define WB25Qxx_CMD_POWER_DOWN_RELEASE      0xAB </span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span><span class="comment"> * Private Prototype</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span><span class="keyword">static</span> uint32_t <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a403c88531edb023065504eddcb22f4b3">WB25Qxx_ReadStatus</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span><span class="keyword">static</span> uint8_t <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce">WB25Qxx_IsBusy</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#ae31db601e8f25e65389adda808c61e8d">WB25Qxx_Write_Enable</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#aea78bd0b9d68918932cd4055777317c3">WB25Qxx_WriteStatus</a>(uint32_t register_status);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#abe79ac77afe147dccaf2977f796329ad">WB25Qxx_Write_QE</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a04c55a0ea26c3794552069171a06f868">WB25Qxx_Enter_QPI</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="structdev__spi__t.html">  129</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a93008a728ebb497723d93cf9cf4154b7">WB25Qxx_Exit_QPI</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a8fa23417edd7b0324ad2a7f77913ed3a">WB25Qxx_Set_QPI_Read_Param</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="structdev__spi__t.html#a719005b63495ad9f6c14c03bffb4c8f4">  131</a></span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">  132</a></span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">  133</a></span><span class="comment"> * Private Constant</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"><a class="line" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">  134</a></span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">  135</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">  136</a></span>{</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>    void (*<a class="code hl_function" href="_l_c_d___j_l_t35002_a_8c.html#a2c1496ee2cfbd6f432304250eeb36d65">spi_port_init</a>)(void);</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>    void (*spi_cs_low)(void);</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">  139</a></span>    void (*spi_cs_high)(void);</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>    uint32_t (*spi_readwrite)(uint32_t data, uint32_t bit_len);</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>    void (*qspi_write)(uint32_t data, uint32_t bit_len);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>    uint32_t (*qspi_read)(uint32_t bit_len);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>} <a class="code hl_struct" href="structdev__spi__t.html">dev_spi_t</a>;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span> </div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span><span class="keyword">static</span> <span class="keyword">const</span> <a class="code hl_struct" href="structdev__spi__t.html">dev_spi_t</a> <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a> = {</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span>    .<a class="code hl_variable" href="structdev__spi__t.html#a719005b63495ad9f6c14c03bffb4c8f4">spi_port_init</a>  = <a class="code hl_function" href="dev__io__spi_8c.html#ae5dc9bbf8a794391f1183411c047dfa2">io_spi_init</a>,</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>    .spi_cs_low     = <a class="code hl_function" href="dev__io__spi_8c.html#a16d2dfe6a5c03f49b9584239472f5c41">IO_SPI_CS_LOW</a>,</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>    .spi_cs_high    = <a class="code hl_function" href="dev__io__spi_8c.html#a97e76f9e7d5b3673003b3062b0982abb">IO_SPI_CS_HIGH</a>,</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>    .spi_readwrite  = <a class="code hl_function" href="dev__io__spi_8c.html#adb59768338d754f15de5d09e175fb3b8">io_spi_readwrite</a>,</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>    .qspi_write     = <a class="code hl_function" href="dev__io__spi_8c.html#acbe161ab6562f9da568695c02f71d18e">io_qspi_write</a>,</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>    .qspi_read      = <a class="code hl_function" href="dev__io__spi_8c.html#a4b9736b990d7b5ce371509d7edd35a70">io_qspi_read</a>,</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>};</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span> </div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a0465c5f017965876cf6ff8859eb2731f">  154</a></span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span><span class="comment"> * Public Function</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span><span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a0465c5f017965876cf6ff8859eb2731f">WB25Qxx_Init</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>{</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a719005b63495ad9f6c14c03bffb4c8f4">spi_port_init</a>();</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span> </div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span><span class="preprocessor">#if (SPI_FLASH_MODE == Quad_SPI || SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span>    <span class="comment">/* 使用 Quad SPI 应开启 SPI-Flash 的 Quad Mode, 本示例已经在 SFC init 里已经置位过 QE bit, 可以直接使用 Quad SPI 操作 */</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>    <span class="comment">// WB25Qxx_Write_QE();</span></div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a04c55a0ea26c3794552069171a06f868">WB25Qxx_Enter_QPI</a>(); <span class="comment">/* 使用 QPI 需要在上电时进行设置 */</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a8fa23417edd7b0324ad2a7f77913ed3a">WB25Qxx_Set_QPI_Read_Param</a>(); </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>    <span class="keyword">static</span> uint8_t w25q_check_id_flag = 1;</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>    <span class="keywordflow">if</span> (w25q_check_id_flag)</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>    {</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>        w25q_check_id_flag = 0;</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span> </div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span>        uint32_t <span class="keywordtype">id</span> = 0;</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>        uint8_t manufacture_id = 0;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>        uint16_t device_id = 0;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span> </div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>        <span class="comment">/* Manufacturer Device ID */</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>        <span class="keywordtype">id</span> = <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a026120f0fec011e2c302b114b5961b55">WB25Qxx_Read_Manufacturer_Device_ID</a>();</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>        manufacture_id = <span class="keywordtype">id</span> &gt;&gt; 8;</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>        device_id = <span class="keywordtype">id</span> &amp; 0xFF;</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span>        <span class="keywordflow">if</span> ((manufacture_id == <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a6963996b0b5cfabd2f20a5c7ef915a6b">WB25Qxx_MANUFACTOR_ID</a>) &amp;&amp; (device_id == <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a898d70676b1ca77b7990d4b8d17b9e9b">WB25Qxx_DEVICE_ID</a>))</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>        {</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span>            printf(<span class="stringliteral">&quot;[Winbond] SPI-Flash already found!\r\n&quot;</span>);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span> </div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>            <span class="keywordflow">while</span> (<a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce">WB25Qxx_IsBusy</a>())</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>                ; <span class="comment">/* 等待内部初始化操作完成 */</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>        }</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>        {</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span>            printf(<span class="stringliteral">&quot;Manufactor ID: %x, Device ID: %x, fail to identify!\r\n&quot;</span>, manufacture_id, device_id);</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span>        }</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span> </div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span>        <span class="comment">/* JEDEC ID */</span></div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span>        <span class="keywordtype">id</span> = <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a8f90491088e0e7053d211def3f87a330">WB25Qxx_Read_JEDEC_ID</a>();</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span>        manufacture_id = <span class="keywordtype">id</span> &gt;&gt; 16;</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span>        device_id = <span class="keywordtype">id</span> &amp; 0xFFFF;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span> </div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>        <span class="keywordflow">if</span> ((manufacture_id == <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a6963996b0b5cfabd2f20a5c7ef915a6b">WB25Qxx_MANUFACTOR_ID</a>) &amp;&amp; (device_id == <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab1a5569183970e41016b5e01748bca43">WB25Qxx_JEDEC_ID</a>))</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span>        {</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>            printf(<span class="stringliteral">&quot;[W25Q128FV] already found [%d] ID!\r\n&quot;</span>, device_id);</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span> </div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span>            <span class="keywordflow">while</span> (<a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce">WB25Qxx_IsBusy</a>())</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span>                ; <span class="comment">/* 等待内部初始化操作完成 */</span></div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span>        }</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>        {</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>            printf(<span class="stringliteral">&quot;Manufactor ID: %x, JEDEC ID: %x, fail to identify!\r\n&quot;</span>, manufacture_id, device_id);</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span>        }</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>    }</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>}</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a026120f0fec011e2c302b114b5961b55">  218</a></span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span>uint16_t <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a026120f0fec011e2c302b114b5961b55">WB25Qxx_Read_Manufacturer_Device_ID</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span>{</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span>    uint8_t manufacture_id = 0, device_id = 0;</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span> </div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span> </div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#aaa52d63c064c0876bbbac9ea72274ba0">WB25Qxx_CMD_READ_CHIP_ID</a>, 8);</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 16);</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(0, 8);</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span> </div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span>    manufacture_id = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span>    device_id = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span> </div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span><span class="preprocessor">#elif (SPI_FLASH_MODE == Standard_SPI)</span></div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#aaa52d63c064c0876bbbac9ea72274ba0">WB25Qxx_CMD_READ_CHIP_ID</a>, 8);</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(0, 24);</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span> </div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span>    manufacture_id = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 8);</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span>    device_id = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 8);</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span> </div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span><span class="preprocessor">#elif (SPI_FLASH_MODE == Quad_SPI)</span></div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a4ef715c150bf0527ee6a893fca31154a">WB25Qxx_CMD_READ_CHIP_ID_QUAD</a>, 8); <span class="comment">/* 单线 cmd */</span></div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span> </div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno">  248</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(0, 32);           <span class="comment">/* 四线 addr &amp;&amp; M7 ~ M0 (Continuous Read Mode : bits M7-0 == [0xFx])  */</span></div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno">  249</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 16); <span class="comment">/* Dummy Clocks */</span></div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno">  250</span> </div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span>    manufacture_id = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>    device_id = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span> </div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span> </div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span>    <span class="keywordflow">return</span> (manufacture_id &lt;&lt; 8) | device_id;</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>}</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a8f90491088e0e7053d211def3f87a330">  259</a></span> </div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno">  265</span>uint32_t <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a8f90491088e0e7053d211def3f87a330">WB25Qxx_Read_JEDEC_ID</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span>{</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno">  267</span>    uint8_t manufacture_id = 0;</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span>    uint16_t device_id = 0;</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span> </div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span> </div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a7a29a7c5cd84c833994d75370d0a8f02">WB25Qxx_CMD_READ_JEDEC_ID</a>, 8);</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span> </div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span>    manufacture_id = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span>    device_id |= <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8) &lt;&lt; 8;</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span>    device_id |= <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span> </div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno">  279</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno">  280</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a7a29a7c5cd84c833994d75370d0a8f02">WB25Qxx_CMD_READ_JEDEC_ID</a>, 8);</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno">  281</span> </div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno">  282</span>    manufacture_id = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 8);</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno">  283</span>    device_id |= <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 8) &lt;&lt; 8;</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno">  284</span>    device_id |= <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 8);</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno">  286</span> </div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno">  287</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno">  288</span> </div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno">  289</span>    <span class="keywordflow">return</span> (manufacture_id &lt;&lt; 16) | device_id;</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno">  290</span>}</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a65571e7929b299af3a763c206a2c98b5">  291</a></span> </div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno">  297</span><span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a65571e7929b299af3a763c206a2c98b5">WB25Qxx_EraseSector</a>(uint32_t addr)</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno">  298</span>{</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno">  299</span>    <span class="comment">/* Write Enable */</span></div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno">  300</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#ae31db601e8f25e65389adda808c61e8d">WB25Qxx_Write_Enable</a>();</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno">  301</span> </div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno">  302</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno">  303</span> </div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno">  304</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno">  305</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a7a17b081e5d51e64acc60324c53f2f3d">WB25Qxx_CMD_ERASE_SECTOR_4KB</a>, 8);</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno">  306</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(addr, 24);</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno">  307</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno">  308</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno">  309</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a7a17b081e5d51e64acc60324c53f2f3d">WB25Qxx_CMD_ERASE_SECTOR_4KB</a>, 8);</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno">  310</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(addr, 24);</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno">  311</span> </div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span> </div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno">  315</span> </div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno">  316</span>    <span class="keywordflow">while</span> (<a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce">WB25Qxx_IsBusy</a>())</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span>        ; <span class="comment">/* 等待内部操作完成 */</span></div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno">  318</span>}</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno">  319</span> </div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno">  327</span><span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a6c158a445050a00b631fd669de3213d7">WB25Qxx_ReadData</a>(uint32_t addr, uint8_t *buff, uint32_t cnt)</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno">  328</span>{</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno">  329</span>    uint32_t i = 0;</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno">  330</span> </div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno">  331</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno">  332</span> </div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno">  333</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno">  334</span>    <span class="comment">/* 0x0B / 0xEB 指令都可以 */</span></div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno">  335</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a8ab716dbcb2ebbe5cbb92676585eb5bc">WB25Qxx_CMD_FAST_READ_DATA</a>, 8); <span class="comment">/* 四线 cmd */</span></div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno">  336</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(addr, 24);                      <span class="comment">/* 四线 addr */</span></div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno">  337</span> </div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno">  338</span>    <span class="keywordflow">for</span> (i = 0; i &lt; 2; i++) <span class="comment">/* Dummy Clocks(Default = 2, 以 0xC0 指令设置的参数为准) */</span></div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno">  339</span>        <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 4);</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno">  340</span> </div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno">  341</span>    <span class="keywordflow">for</span> (i = 0; i &lt; cnt; i++)</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno">  342</span>    {</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno">  343</span>        buff[i] = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno">  344</span>    }</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno">  345</span> </div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno">  346</span><span class="preprocessor">#elif (SPI_FLASH_MODE == Standard_SPI)</span></div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno">  347</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a8ab716dbcb2ebbe5cbb92676585eb5bc">WB25Qxx_CMD_FAST_READ_DATA</a>, 8);</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno">  348</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>((addr &lt;&lt; 8) | 0, 32);</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno">  349</span> </div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno">  350</span>    <span class="keywordflow">for</span> (i = 0; i &lt; cnt; ++i)</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno">  351</span>    {</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno">  352</span>        buff[i] = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 8);</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno">  353</span>    }</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno">  354</span> </div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno">  355</span><span class="preprocessor">#elif (SPI_FLASH_MODE == Quad_SPI)</span></div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno">  356</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a9b4b5c3946502ca9fbf4d1259efbadcf">WB25Qxx_CMD_FAST_READ_QUAD_IO</a>, 8); <span class="comment">/* 单线 cmd */</span></div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno">  357</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>((addr &lt;&lt; 8) | 0x00, 32);              <span class="comment">/* 四线 addr &amp;&amp; M7 ~ M0 (Continuous Read Mode : bits M5-4 == [1,0]) */</span></div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno">  358</span> </div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno">  359</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 16); <span class="comment">/* Dummy Clocks */</span></div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno">  360</span> </div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno">  361</span>    <span class="keywordflow">for</span> (i = 0; i &lt; cnt; i++)</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno">  362</span>    {</div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno">  363</span>        buff[i] = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno">  364</span>    }</div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno">  365</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno">  366</span> </div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno">  367</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno">  368</span>}</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno">  369</span> </div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno">  377</span><span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a6af72df055a5bc71064719f68842f515">WB25Qxx_WritePage</a>(uint32_t addr, uint8_t *buff, uint32_t cnt)</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno">  378</span>{</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno">  379</span>    uint32_t i = 0;</div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno">  380</span> </div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno">  381</span>    <span class="comment">/* Write Enable */</span></div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno">  382</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#ae31db601e8f25e65389adda808c61e8d">WB25Qxx_Write_Enable</a>();</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno">  383</span> </div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno">  384</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno">  385</span> </div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno">  386</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno">  387</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#add8e47c7436ee8158d45cc2a9d34999b">WB25Qxx_CMD_PROGRAM_PAGE</a>, 8); <span class="comment">/* 四线 cmd */</span></div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno">  388</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(addr, 24);                    <span class="comment">/* 四线 addr */</span></div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno">  389</span>    <span class="keywordflow">for</span> (i = 0; i &lt; cnt; ++i)</div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno">  390</span>    {</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno">  391</span>        <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(buff[i], 8);</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno">  392</span>    }</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno">  393</span> </div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno">  394</span><span class="preprocessor">#elif (SPI_FLASH_MODE == Quad_SPI)</span></div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno">  395</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a4040c3c8299573cd8222219eef655c44">WB25Qxx_CMD_PROGRAM_PAGE_QUAD</a>, 8); <span class="comment">/* 单线 cmd */</span></div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno">  396</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(addr, 24);                         <span class="comment">/* 单线 addr */</span></div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno">  397</span>    <span class="keywordflow">for</span> (i = 0; i &lt; cnt; ++i)</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno">  398</span>    {</div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno">  399</span>        <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(buff[i], 8);</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno">  400</span>    }</div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno">  401</span> </div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno">  402</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno">  403</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#add8e47c7436ee8158d45cc2a9d34999b">WB25Qxx_CMD_PROGRAM_PAGE</a>, 8); <span class="comment">/* 单线 cmd */</span></div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno">  404</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(addr, 24);                    <span class="comment">/* 单线 addr */</span></div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno">  405</span>    <span class="keywordflow">for</span> (i = 0; i &lt; cnt; ++i)</div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno">  406</span>    {</div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno">  407</span>        <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(buff[i], 8);</div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno">  408</span>    }</div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno">  409</span> </div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno">  410</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno">  411</span> </div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno">  412</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno">  413</span> </div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno">  414</span>    <span class="keywordflow">while</span> (<a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce">WB25Qxx_IsBusy</a>())</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno">  415</span>        ; <span class="comment">/* 等待内部操作完成 */</span></div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno">  416</span>}</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno">  417</span> </div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno">  425</span><span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#af3283a1cc275bb536b31ab945449b40c">WB25Qxx_WriteBuff</a>(uint32_t addr, uint8_t *buff, uint32_t cnt)</div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno">  426</span>{</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno">  427</span>    uint32_t num_page = 0, page_remain = 0, align_addr = 0, align_count = 0, temp = 0;</div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno">  428</span> </div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno">  429</span>    align_addr = addr % <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;        <span class="comment">/* mod 运算求余，若 addr 是 WB25Qxx_A_PAGE_BYTES 整数倍，运算结果值为 0 */</span></div>
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno">  430</span>    align_count = <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a> - align_addr; <span class="comment">/* 差 count 个数据值，刚好可以对齐到页地址 */</span></div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno">  431</span>    num_page = cnt / <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;           <span class="comment">/* 计算出要写多少整数页 */</span></div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno">  432</span>    page_remain = cnt % <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;        <span class="comment">/* mod 运算求余，计算出剩余不满一页的字节数 */</span></div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno">  433</span> </div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno">  434</span>    void (*Page_Write)(uint32_t addr, uint8_t *buff, uint32_t cnt) = <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a6af72df055a5bc71064719f68842f515">WB25Qxx_WritePage</a>;</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno">  435</span> </div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno">  436</span>    <span class="keywordflow">if</span> (align_addr == 0) <span class="comment">/* align_addr = 0,则 addr 刚好按页对齐 aligned */</span></div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno">  437</span>    {</div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno">  438</span>        <span class="keywordflow">if</span> (num_page == 0) <span class="comment">/* 数据量不足一页 */</span></div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno">  439</span>        {</div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno">  440</span>            Page_Write(addr, buff, cnt);</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno">  441</span>        }</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno">  442</span>        <span class="keywordflow">else</span> <span class="comment">/* 数据量大于一页 */</span></div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno">  443</span>        {</div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno">  444</span>            <span class="comment">/* 先把整数页都写了 */</span></div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno">  445</span>            <span class="keywordflow">while</span> (num_page--)</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno">  446</span>            {</div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno">  447</span>                Page_Write(addr, buff, <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>);</div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno">  448</span>                addr += <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno">  449</span>                buff += <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;</div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno">  450</span>            }</div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno">  451</span>            <span class="keywordflow">if</span> (page_remain &gt; 0) <span class="comment">/* 若有多余的不满一页的数据，把它写完 */</span></div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno">  452</span>            {</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno">  453</span>                Page_Write(addr, buff, page_remain);</div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno">  454</span>            }</div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno">  455</span>        }</div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno">  456</span>    }</div>
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno">  457</span>    <span class="keywordflow">else</span> <span class="comment">/* 若地址与 WB25Qxx_A_PAGE_BYTES 不对齐  */</span></div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno">  458</span>    {</div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno">  459</span>        <span class="keywordflow">if</span> (num_page == 0) <span class="comment">/* 数据量不足一页 */</span></div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno">  460</span>        {</div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno">  461</span>            <span class="keywordflow">if</span> (page_remain &gt; align_count) <span class="comment">/* 当前页剩余的 count 个位置比 align_count 小，写不完 */</span></div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno">  462</span>            {</div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno">  463</span>                temp = page_remain - align_count;</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno">  464</span> </div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno">  465</span>                <span class="comment">/* 先写满当前页 */</span></div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno">  466</span>                Page_Write(addr, buff, align_count);</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno">  467</span>                addr += align_count;</div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno">  468</span>                buff += align_count;</div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno">  469</span> </div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno">  470</span>                <span class="comment">/* 再写剩余的数据 */</span></div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno">  471</span>                Page_Write(addr, buff, temp);</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno">  472</span>            }</div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno">  473</span>            <span class="keywordflow">else</span> <span class="comment">/* 当前页剩余的 count 个位置能写完 align_count 个数据 */</span></div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno">  474</span>            {</div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno">  475</span>                Page_Write(addr, buff, cnt);</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno">  476</span>            }</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno">  477</span>        }</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno">  478</span>        <span class="keywordflow">else</span> <span class="comment">/* 数据量大于一页 */</span></div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno">  479</span>        {</div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno">  480</span>            <span class="comment">/* 地址不对齐多出的 count 分开处理，不加入这个运算 */</span></div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno">  481</span>            cnt -= align_count;</div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno">  482</span>            num_page = cnt / <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno">  483</span>            page_remain = cnt % <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;</div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno">  484</span> </div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno">  485</span>            Page_Write(addr, buff, align_count);</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno">  486</span>            addr += align_count;</div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno">  487</span>            buff += align_count;</div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno">  488</span> </div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno">  489</span>            <span class="comment">/* 把整数页都写了 */</span></div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno">  490</span>            <span class="keywordflow">while</span> (num_page--)</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno">  491</span>            {</div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno">  492</span>                Page_Write(addr, buff, <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>);</div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno">  493</span>                addr += <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;</div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno">  494</span>                buff += <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a>;</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno">  495</span>            }</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno">  496</span>            <span class="comment">/* 若有多余的不满一页的数据，把它写完 */</span></div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno">  497</span>            <span class="keywordflow">if</span> (page_remain != 0)</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span>            {</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno">  499</span>                Page_Write(addr, buff, page_remain);</div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno">  500</span>            }</div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno">  501</span>        }</div>
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno">  502</span>    }</div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno">  503</span>}</div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno">  504</span> </div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno">  511</span>uint8_t <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a31f4382f10e496b80033a9550032fd1f">WB25Qxx_CheckTest</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno">  512</span>{</div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno">  513</span><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno">  514</span> </div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno">  515</span>    uint8_t res = 0;</div>
<div class="line"><a id="l00516" name="l00516"></a><span class="lineno">  516</span> </div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno">  517</span>    uint32_t i = 0;</div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno">  518</span> </div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno">  519</span><span class="preprocessor">#define DST_ADDR            (4096 * 5) </span><span class="comment">/* 必须对齐 4K */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno">  520</span><span class="preprocessor">#define DST_NUM_BYTES       (16)  </span><span class="comment">/* 必须是 4 的倍数 */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno">  521</span> </div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno">  522</span>    uint8_t rd_cache[<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab4d1b6dd306f907a5b365f7ff0a3d1e5">DST_NUM_BYTES</a>] __attribute__((aligned(4)));</div>
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno">  523</span>    uint8_t wr_cache[<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ab4d1b6dd306f907a5b365f7ff0a3d1e5">DST_NUM_BYTES</a>] __attribute__((aligned(4)));</div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno">  524</span>    memset(rd_cache, 0, <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0]));</div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno">  525</span>    <span class="comment">// memset(wr_cache, 0, sizeof(wr_cache) / sizeof(wr_cache[0]));</span></div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno">  526</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(wr_cache) / <span class="keyword">sizeof</span>(wr_cache[0]); ++i)</div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno">  527</span>    {</div>
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno">  528</span>        wr_cache[i] = i;</div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno">  529</span>    }</div>
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno">  530</span> </div>
<div class="line"><a id="l00531" name="l00531"></a><span class="lineno">  531</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a0465c5f017965876cf6ff8859eb2731f">WB25Qxx_Init</a>();</div>
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno">  532</span> </div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno">  533</span>    printf(<span class="stringliteral">&quot;\r\n************** IO模拟 第一次读取***********************\r\n&quot;</span>);</div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno">  534</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0]); ++i)</div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno">  535</span>    {</div>
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno">  536</span>        <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a6c158a445050a00b631fd669de3213d7">WB25Qxx_ReadData</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a> + i, (uint8_t *)&amp;rd_cache[i], 1);</div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno">  537</span>        printf(<span class="stringliteral">&quot;rd_cache[%d] = 0x[%x]   &quot;</span>, i, rd_cache[i]);</div>
<div class="line"><a id="l00538" name="l00538"></a><span class="lineno">  538</span>    }</div>
<div class="line"><a id="l00539" name="l00539"></a><span class="lineno">  539</span> </div>
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno">  540</span>    printf(<span class="stringliteral">&quot;\r\n************** IO模拟 擦除后读取***********************\r\n&quot;</span>);</div>
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno">  541</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a65571e7929b299af3a763c206a2c98b5">WB25Qxx_EraseSector</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a>);</div>
<div class="line"><a id="l00542" name="l00542"></a><span class="lineno">  542</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0]); ++i)</div>
<div class="line"><a id="l00543" name="l00543"></a><span class="lineno">  543</span>    {</div>
<div class="line"><a id="l00544" name="l00544"></a><span class="lineno">  544</span>        <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a6c158a445050a00b631fd669de3213d7">WB25Qxx_ReadData</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a> + i, (uint8_t *)&amp;rd_cache[i], 1);</div>
<div class="line"><a id="l00545" name="l00545"></a><span class="lineno">  545</span>        printf(<span class="stringliteral">&quot;rd_cache[%d] = 0x[%x]   &quot;</span>, i, rd_cache[i]);</div>
<div class="line"><a id="l00546" name="l00546"></a><span class="lineno">  546</span>    }</div>
<div class="line"><a id="l00547" name="l00547"></a><span class="lineno">  547</span> </div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno">  548</span>    printf(<span class="stringliteral">&quot;\r\n************** IO模拟 按页写入后读取***********************\r\n&quot;</span>);</div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno">  549</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(wr_cache) / <span class="keyword">sizeof</span>(wr_cache[0]); ++i)</div>
<div class="line"><a id="l00550" name="l00550"></a><span class="lineno">  550</span>    {</div>
<div class="line"><a id="l00551" name="l00551"></a><span class="lineno">  551</span>        <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a6af72df055a5bc71064719f68842f515">WB25Qxx_WritePage</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a> + i, (uint8_t *)&amp;wr_cache[i], 1);</div>
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno">  552</span>    }</div>
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno">  553</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0]); ++i)</div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno">  554</span>    {</div>
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno">  555</span>        <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a6c158a445050a00b631fd669de3213d7">WB25Qxx_ReadData</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a> + i, (uint8_t *)&amp;rd_cache[i], 1);</div>
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno">  556</span>        printf(<span class="stringliteral">&quot;rd_cache[%d] = 0x[%x]   &quot;</span>, i, rd_cache[i]);</div>
<div class="line"><a id="l00557" name="l00557"></a><span class="lineno">  557</span>    }</div>
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno">  558</span> </div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno">  559</span>    <span class="keywordflow">if</span> (0 == memcmp(rd_cache, wr_cache, <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0])))</div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno">  560</span>    {</div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno">  561</span>        printf(<span class="stringliteral">&quot;\r\n [rd_cache] and [wr_cache] memcmp is ok!\r\n&quot;</span>);</div>
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno">  562</span>    }</div>
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno">  563</span>    <span class="keywordflow">else</span></div>
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno">  564</span>    {</div>
<div class="line"><a id="l00565" name="l00565"></a><span class="lineno">  565</span>        res = 1;</div>
<div class="line"><a id="l00566" name="l00566"></a><span class="lineno">  566</span>        printf(<span class="stringliteral">&quot;\r\n [rd_cache] and [wr_cache] memcmp is fail!\r\n&quot;</span>);</div>
<div class="line"><a id="l00567" name="l00567"></a><span class="lineno">  567</span>    }</div>
<div class="line"><a id="l00568" name="l00568"></a><span class="lineno">  568</span> </div>
<div class="line"><a id="l00569" name="l00569"></a><span class="lineno">  569</span>    printf(<span class="stringliteral">&quot;\r\n************** IO模拟 不按页写入后读取***********************\r\n&quot;</span>);</div>
<div class="line"><a id="l00570" name="l00570"></a><span class="lineno">  570</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(wr_cache) / <span class="keyword">sizeof</span>(wr_cache[0]); ++i)</div>
<div class="line"><a id="l00571" name="l00571"></a><span class="lineno">  571</span>    {</div>
<div class="line"><a id="l00572" name="l00572"></a><span class="lineno">  572</span>        <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#af3283a1cc275bb536b31ab945449b40c">WB25Qxx_WriteBuff</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a> + i, (uint8_t *)&amp;wr_cache[i], 1);</div>
<div class="line"><a id="l00573" name="l00573"></a><span class="lineno">  573</span>    }</div>
<div class="line"><a id="l00574" name="l00574"></a><span class="lineno">  574</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0]); ++i)</div>
<div class="line"><a id="l00575" name="l00575"></a><span class="lineno">  575</span>    {</div>
<div class="line"><a id="l00576" name="l00576"></a><span class="lineno">  576</span>        <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a6c158a445050a00b631fd669de3213d7">WB25Qxx_ReadData</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a> + i, (uint8_t *)&amp;rd_cache[i], 1);</div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno">  577</span>        printf(<span class="stringliteral">&quot;rd_cache[%d] = 0x[%x]   &quot;</span>, i, rd_cache[i]);</div>
<div class="line"><a id="l00578" name="l00578"></a><span class="lineno">  578</span>    }</div>
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno">  579</span> </div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno">  580</span>    <span class="keywordflow">if</span> (0 == memcmp(rd_cache, wr_cache, <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0])))</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno">  581</span>    {</div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno">  582</span>        printf(<span class="stringliteral">&quot;\r\n [rd_cache] and [wr_cache] memcmp is ok!\r\n&quot;</span>);</div>
<div class="line"><a id="l00583" name="l00583"></a><span class="lineno">  583</span>    }</div>
<div class="line"><a id="l00584" name="l00584"></a><span class="lineno">  584</span>    <span class="keywordflow">else</span></div>
<div class="line"><a id="l00585" name="l00585"></a><span class="lineno">  585</span>    {</div>
<div class="line"><a id="l00586" name="l00586"></a><span class="lineno">  586</span>        res = 1;</div>
<div class="line"><a id="l00587" name="l00587"></a><span class="lineno">  587</span>        printf(<span class="stringliteral">&quot;\r\n [rd_cache] and [wr_cache] memcmp is fail!\r\n&quot;</span>);</div>
<div class="line"><a id="l00588" name="l00588"></a><span class="lineno">  588</span>    }</div>
<div class="line"><a id="l00589" name="l00589"></a><span class="lineno">  589</span> </div>
<div class="line"><a id="l00590" name="l00590"></a><span class="lineno">  590</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00591" name="l00591"></a><span class="lineno">  591</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a93008a728ebb497723d93cf9cf4154b7">WB25Qxx_Exit_QPI</a>(); <span class="comment">/* 退出 QPI 模式, SFC support Quad_SPI, NO support QPI. */</span></div>
<div class="line"><a id="l00592" name="l00592"></a><span class="lineno">  592</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00593" name="l00593"></a><span class="lineno">  593</span> </div>
<div class="line"><a id="l00594" name="l00594"></a><span class="lineno">  594</span><span class="preprocessor">#if 0</span></div>
<div class="line"><a id="l00595" name="l00595"></a><span class="lineno">  595</span><span class="preprocessor">#include &quot;<a class="code" href="dev__sfc_8h.html">dev_sfc.h</a>&quot;</span></div>
<div class="line"><a id="l00596" name="l00596"></a><span class="lineno">  596</span>    printf(<span class="stringliteral">&quot;\r\n************** SFC 读取源数据***********************\r\n&quot;</span>);</div>
<div class="line"><a id="l00597" name="l00597"></a><span class="lineno">  597</span>    <a class="code hl_function" href="dev__sfc_8c.html#aad5d116153c77313a1212733b556a578">sfc_init</a>();</div>
<div class="line"><a id="l00598" name="l00598"></a><span class="lineno">  598</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0]); i += 4)</div>
<div class="line"><a id="l00599" name="l00599"></a><span class="lineno">  599</span>    {</div>
<div class="line"><a id="l00600" name="l00600"></a><span class="lineno">  600</span>        SFC_Read(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a> + i, (uint32_t *)&amp;rd_cache[i], 1);</div>
<div class="line"><a id="l00601" name="l00601"></a><span class="lineno">  601</span>    }</div>
<div class="line"><a id="l00602" name="l00602"></a><span class="lineno">  602</span>    <span class="keywordflow">for</span> (i = 0; i &lt; <span class="keyword">sizeof</span>(rd_cache) / <span class="keyword">sizeof</span>(rd_cache[0]); ++i)</div>
<div class="line"><a id="l00603" name="l00603"></a><span class="lineno">  603</span>    {</div>
<div class="line"><a id="l00604" name="l00604"></a><span class="lineno">  604</span>        printf(<span class="stringliteral">&quot;rd_cache[%d] = 0x[%x]   &quot;</span>, i, rd_cache[i]);</div>
<div class="line"><a id="l00605" name="l00605"></a><span class="lineno">  605</span>    }</div>
<div class="line"><a id="l00606" name="l00606"></a><span class="lineno">  606</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00607" name="l00607"></a><span class="lineno">  607</span>    </div>
<div class="line"><a id="l00608" name="l00608"></a><span class="lineno">  608</span>    <span class="keywordflow">return</span> res;</div>
<div class="line"><a id="l00609" name="l00609"></a><span class="lineno">  609</span>}</div>
<div class="line"><a id="l00610" name="l00610"></a><span class="lineno">  610</span> </div>
<div class="line"><a id="l00611" name="l00611"></a><span class="lineno">  611</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00612" name="l00612"></a><span class="lineno">  612</span><span class="comment"> * Private Function</span></div>
<div class="line"><a id="l00613" name="l00613"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a403c88531edb023065504eddcb22f4b3">  613</a></span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00619" name="l00619"></a><span class="lineno">  619</span><span class="keyword">static</span> uint32_t <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a403c88531edb023065504eddcb22f4b3">WB25Qxx_ReadStatus</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00620" name="l00620"></a><span class="lineno">  620</span>{</div>
<div class="line"><a id="l00621" name="l00621"></a><span class="lineno">  621</span>    uint32_t status = 0;</div>
<div class="line"><a id="l00622" name="l00622"></a><span class="lineno">  622</span> </div>
<div class="line"><a id="l00623" name="l00623"></a><span class="lineno">  623</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00624" name="l00624"></a><span class="lineno">  624</span>    <span class="comment">/* Register - 1 */</span></div>
<div class="line"><a id="l00625" name="l00625"></a><span class="lineno">  625</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00626" name="l00626"></a><span class="lineno">  626</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a4491f61ab80618ea07fcd79ebf46a38e">WB25Qxx_CMD_READ_STATUS_1</a>, 8);</div>
<div class="line"><a id="l00627" name="l00627"></a><span class="lineno">  627</span>    status = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8);</div>
<div class="line"><a id="l00628" name="l00628"></a><span class="lineno">  628</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00629" name="l00629"></a><span class="lineno">  629</span> </div>
<div class="line"><a id="l00630" name="l00630"></a><span class="lineno">  630</span>    <span class="comment">/* Register - 2 */</span></div>
<div class="line"><a id="l00631" name="l00631"></a><span class="lineno">  631</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00632" name="l00632"></a><span class="lineno">  632</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a9b4d04305e7fab38b63926c818cfe608">WB25Qxx_CMD_READ_STATUS_2</a>, 8);</div>
<div class="line"><a id="l00633" name="l00633"></a><span class="lineno">  633</span>    status |= <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">qspi_read</a>(8) &lt;&lt; 8;</div>
<div class="line"><a id="l00634" name="l00634"></a><span class="lineno">  634</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00635" name="l00635"></a><span class="lineno">  635</span> </div>
<div class="line"><a id="l00636" name="l00636"></a><span class="lineno">  636</span>    <span class="comment">/* Register - 3</span></div>
<div class="line"><a id="l00637" name="l00637"></a><span class="lineno">  637</span><span class="comment">    Dev_SPI.spi_cs_low();</span></div>
<div class="line"><a id="l00638" name="l00638"></a><span class="lineno">  638</span><span class="comment">    Dev_SPI.qspi_write(WB25Qxx_CMD_READ_STATUS_3, 8);</span></div>
<div class="line"><a id="l00639" name="l00639"></a><span class="lineno">  639</span><span class="comment">    status |= Dev_SPI.qspi_read(8) &lt;&lt; 16;</span></div>
<div class="line"><a id="l00640" name="l00640"></a><span class="lineno">  640</span><span class="comment">    Dev_SPI.spi_cs_high();</span></div>
<div class="line"><a id="l00641" name="l00641"></a><span class="lineno">  641</span><span class="comment">    */</span></div>
<div class="line"><a id="l00642" name="l00642"></a><span class="lineno">  642</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00643" name="l00643"></a><span class="lineno">  643</span>    <span class="comment">/* Register - 1 */</span></div>
<div class="line"><a id="l00644" name="l00644"></a><span class="lineno">  644</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00645" name="l00645"></a><span class="lineno">  645</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a4491f61ab80618ea07fcd79ebf46a38e">WB25Qxx_CMD_READ_STATUS_1</a>, 8);</div>
<div class="line"><a id="l00646" name="l00646"></a><span class="lineno">  646</span>    status = <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 8);</div>
<div class="line"><a id="l00647" name="l00647"></a><span class="lineno">  647</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00648" name="l00648"></a><span class="lineno">  648</span> </div>
<div class="line"><a id="l00649" name="l00649"></a><span class="lineno">  649</span>    <span class="comment">/* Register - 2 */</span></div>
<div class="line"><a id="l00650" name="l00650"></a><span class="lineno">  650</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00651" name="l00651"></a><span class="lineno">  651</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a9b4d04305e7fab38b63926c818cfe608">WB25Qxx_CMD_READ_STATUS_2</a>, 8);</div>
<div class="line"><a id="l00652" name="l00652"></a><span class="lineno">  652</span>    status |= <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a>, 8) &lt;&lt; 8;</div>
<div class="line"><a id="l00653" name="l00653"></a><span class="lineno">  653</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00654" name="l00654"></a><span class="lineno">  654</span> </div>
<div class="line"><a id="l00655" name="l00655"></a><span class="lineno">  655</span>    <span class="comment">/* Register - 3</span></div>
<div class="line"><a id="l00656" name="l00656"></a><span class="lineno">  656</span><span class="comment">    Dev_SPI.spi_cs_low();</span></div>
<div class="line"><a id="l00657" name="l00657"></a><span class="lineno">  657</span><span class="comment">    Dev_SPI.spi_readwrite(WB25Qxx_CMD_READ_STATUS_3, 8);</span></div>
<div class="line"><a id="l00658" name="l00658"></a><span class="lineno">  658</span><span class="comment">    status |= Dev_SPI.spi_readwrite(DUMMY_CLOCK, 8) &lt;&lt; 16;</span></div>
<div class="line"><a id="l00659" name="l00659"></a><span class="lineno">  659</span><span class="comment">    Dev_SPI.spi_cs_high();</span></div>
<div class="line"><a id="l00660" name="l00660"></a><span class="lineno">  660</span><span class="comment">    */</span></div>
<div class="line"><a id="l00661" name="l00661"></a><span class="lineno">  661</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00662" name="l00662"></a><span class="lineno">  662</span>    <span class="keywordflow">return</span> status;</div>
<div class="line"><a id="l00663" name="l00663"></a><span class="lineno">  663</span>}</div>
<div class="line"><a id="l00664" name="l00664"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce">  664</a></span> </div>
<div class="line"><a id="l00670" name="l00670"></a><span class="lineno">  670</span><span class="keyword">static</span> uint8_t <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce">WB25Qxx_IsBusy</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00671" name="l00671"></a><span class="lineno">  671</span>{</div>
<div class="line"><a id="l00672" name="l00672"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#ae31db601e8f25e65389adda808c61e8d">  672</a></span>    <span class="keywordflow">return</span> (<a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a403c88531edb023065504eddcb22f4b3">WB25Qxx_ReadStatus</a>() &amp; <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a76dd4fc3eb8373980abf7a0a826a2171">WB25Qxx_STATUS_WIP_Msk</a>) ? 1 : 0;</div>
<div class="line"><a id="l00673" name="l00673"></a><span class="lineno">  673</span>}</div>
<div class="line"><a id="l00674" name="l00674"></a><span class="lineno">  674</span> </div>
<div class="line"><a id="l00678" name="l00678"></a><span class="lineno">  678</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#ae31db601e8f25e65389adda808c61e8d">WB25Qxx_Write_Enable</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00679" name="l00679"></a><span class="lineno">  679</span>{</div>
<div class="line"><a id="l00680" name="l00680"></a><span class="lineno">  680</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00681" name="l00681"></a><span class="lineno">  681</span> </div>
<div class="line"><a id="l00682" name="l00682"></a><span class="lineno">  682</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00683" name="l00683"></a><span class="lineno">  683</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ac09f7d91a3a83bb1b6a993dbab130583">WB25Qxx_CMD_WRITE_ENABLE</a>, 8);</div>
<div class="line"><a id="l00684" name="l00684"></a><span class="lineno">  684</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00685" name="l00685"></a><span class="lineno">  685</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#ac09f7d91a3a83bb1b6a993dbab130583">WB25Qxx_CMD_WRITE_ENABLE</a>, 8);</div>
<div class="line"><a id="l00686" name="l00686"></a><span class="lineno">  686</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00687" name="l00687"></a><span class="lineno">  687</span> </div>
<div class="line"><a id="l00688" name="l00688"></a><span class="lineno">  688</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00689" name="l00689"></a><span class="lineno">  689</span>}</div>
<div class="line"><a id="l00690" name="l00690"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#aea78bd0b9d68918932cd4055777317c3">  690</a></span> </div>
<div class="line"><a id="l00696" name="l00696"></a><span class="lineno">  696</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#aea78bd0b9d68918932cd4055777317c3">WB25Qxx_WriteStatus</a>(uint32_t register_status)</div>
<div class="line"><a id="l00697" name="l00697"></a><span class="lineno">  697</span>{</div>
<div class="line"><a id="l00698" name="l00698"></a><span class="lineno">  698</span>    <span class="comment">/* Write Enable */</span></div>
<div class="line"><a id="l00699" name="l00699"></a><span class="lineno">  699</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#ae31db601e8f25e65389adda808c61e8d">WB25Qxx_Write_Enable</a>();</div>
<div class="line"><a id="l00700" name="l00700"></a><span class="lineno">  700</span> </div>
<div class="line"><a id="l00701" name="l00701"></a><span class="lineno">  701</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00702" name="l00702"></a><span class="lineno">  702</span>    <span class="comment">/* Register - 1 */</span></div>
<div class="line"><a id="l00703" name="l00703"></a><span class="lineno">  703</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00704" name="l00704"></a><span class="lineno">  704</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a41f43e7631d713c3f96058444e57b90a">WB25Qxx_CMD_WRITE_STATUS_1</a>, 8);</div>
<div class="line"><a id="l00705" name="l00705"></a><span class="lineno">  705</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(register_status, 8);</div>
<div class="line"><a id="l00706" name="l00706"></a><span class="lineno">  706</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00707" name="l00707"></a><span class="lineno">  707</span> </div>
<div class="line"><a id="l00708" name="l00708"></a><span class="lineno">  708</span>    <span class="comment">/* Register - 2 */</span></div>
<div class="line"><a id="l00709" name="l00709"></a><span class="lineno">  709</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00710" name="l00710"></a><span class="lineno">  710</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#aee6643c146233d7cacb6ade01f6f7761">WB25Qxx_CMD_WRITE_STATUS_2</a>, 8);</div>
<div class="line"><a id="l00711" name="l00711"></a><span class="lineno">  711</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(register_status &gt;&gt; 8, 8);</div>
<div class="line"><a id="l00712" name="l00712"></a><span class="lineno">  712</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00713" name="l00713"></a><span class="lineno">  713</span> </div>
<div class="line"><a id="l00714" name="l00714"></a><span class="lineno">  714</span>    <span class="comment">/* Register - 3</span></div>
<div class="line"><a id="l00715" name="l00715"></a><span class="lineno">  715</span><span class="comment">    Dev_SPI.spi_cs_low();</span></div>
<div class="line"><a id="l00716" name="l00716"></a><span class="lineno">  716</span><span class="comment">    Dev_SPI.qspi_write(WB25Qxx_CMD_WRITE_STATUS_3, 8);</span></div>
<div class="line"><a id="l00717" name="l00717"></a><span class="lineno">  717</span><span class="comment">    Dev_SPI.qspi_write(register_status &gt;&gt; 16, 8);</span></div>
<div class="line"><a id="l00718" name="l00718"></a><span class="lineno">  718</span><span class="comment">    Dev_SPI.spi_cs_high();</span></div>
<div class="line"><a id="l00719" name="l00719"></a><span class="lineno">  719</span><span class="comment">    */</span></div>
<div class="line"><a id="l00720" name="l00720"></a><span class="lineno">  720</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00721" name="l00721"></a><span class="lineno">  721</span>    <span class="comment">/* Register - 1 */</span></div>
<div class="line"><a id="l00722" name="l00722"></a><span class="lineno">  722</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00723" name="l00723"></a><span class="lineno">  723</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a41f43e7631d713c3f96058444e57b90a">WB25Qxx_CMD_WRITE_STATUS_1</a>, 8);</div>
<div class="line"><a id="l00724" name="l00724"></a><span class="lineno">  724</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(register_status, 8);</div>
<div class="line"><a id="l00725" name="l00725"></a><span class="lineno">  725</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00726" name="l00726"></a><span class="lineno">  726</span> </div>
<div class="line"><a id="l00727" name="l00727"></a><span class="lineno">  727</span>    <span class="comment">/* Register - 2 */</span></div>
<div class="line"><a id="l00728" name="l00728"></a><span class="lineno">  728</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00729" name="l00729"></a><span class="lineno">  729</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#aee6643c146233d7cacb6ade01f6f7761">WB25Qxx_CMD_WRITE_STATUS_2</a>, 8);</div>
<div class="line"><a id="l00730" name="l00730"></a><span class="lineno">  730</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(register_status &gt;&gt; 8, 8);</div>
<div class="line"><a id="l00731" name="l00731"></a><span class="lineno">  731</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00732" name="l00732"></a><span class="lineno">  732</span> </div>
<div class="line"><a id="l00733" name="l00733"></a><span class="lineno">  733</span>    <span class="comment">/* Register - 3</span></div>
<div class="line"><a id="l00734" name="l00734"></a><span class="lineno">  734</span><span class="comment">    Dev_SPI.spi_cs_low();</span></div>
<div class="line"><a id="l00735" name="l00735"></a><span class="lineno">  735</span><span class="comment">    Dev_SPI.spi_readwrite(WB25Qxx_CMD_WRITE_STATUS_3, 8);</span></div>
<div class="line"><a id="l00736" name="l00736"></a><span class="lineno">  736</span><span class="comment">    Dev_SPI.spi_readwrite(register_status &gt;&gt; 16, 8);</span></div>
<div class="line"><a id="l00737" name="l00737"></a><span class="lineno">  737</span><span class="comment">    Dev_SPI.spi_cs_high();</span></div>
<div class="line"><a id="l00738" name="l00738"></a><span class="lineno">  738</span><span class="comment">    */</span></div>
<div class="line"><a id="l00739" name="l00739"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#abe79ac77afe147dccaf2977f796329ad">  739</a></span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00740" name="l00740"></a><span class="lineno">  740</span>}</div>
<div class="line"><a id="l00741" name="l00741"></a><span class="lineno">  741</span> </div>
<div class="line"><a id="l00745" name="l00745"></a><span class="lineno">  745</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#abe79ac77afe147dccaf2977f796329ad">WB25Qxx_Write_QE</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00746" name="l00746"></a><span class="lineno">  746</span>{</div>
<div class="line"><a id="l00747" name="l00747"></a><span class="lineno">  747</span>    uint32_t status = 0;</div>
<div class="line"><a id="l00748" name="l00748"></a><span class="lineno">  748</span> </div>
<div class="line"><a id="l00749" name="l00749"></a><span class="lineno">  749</span>    status = <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a403c88531edb023065504eddcb22f4b3">WB25Qxx_ReadStatus</a>();</div>
<div class="line"><a id="l00750" name="l00750"></a><span class="lineno">  750</span> </div>
<div class="line"><a id="l00751" name="l00751"></a><span class="lineno">  751</span>    <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#aea78bd0b9d68918932cd4055777317c3">WB25Qxx_WriteStatus</a>(status | <a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#aa38cc8ee8d4b1126001e721d05247bfe">WB25Qxx_STATUS_QE_Msk</a>);</div>
<div class="line"><a id="l00752" name="l00752"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a04c55a0ea26c3794552069171a06f868">  752</a></span>}</div>
<div class="line"><a id="l00753" name="l00753"></a><span class="lineno">  753</span> </div>
<div class="line"><a id="l00754" name="l00754"></a><span class="lineno">  754</span><span class="preprocessor">#if (SPI_FLASH_MODE == QPI)</span></div>
<div class="line"><a id="l00758" name="l00758"></a><span class="lineno">  758</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a04c55a0ea26c3794552069171a06f868">WB25Qxx_Enter_QPI</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00759" name="l00759"></a><span class="lineno">  759</span>{</div>
<div class="line"><a id="l00760" name="l00760"></a><span class="lineno">  760</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00761" name="l00761"></a><span class="lineno">  761</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">spi_readwrite</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#af202e311e227e572f6a06817e6624ec6">WB25Qxx_CMD_ENTER_QPI</a>, 8);</div>
<div class="line"><a id="l00762" name="l00762"></a><span class="lineno"><a class="line" href="_s_p_i___w_b25_qxx_8c.html#a93008a728ebb497723d93cf9cf4154b7">  762</a></span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00763" name="l00763"></a><span class="lineno">  763</span>}</div>
<div class="line"><a id="l00764" name="l00764"></a><span class="lineno">  764</span> </div>
<div class="line"><a id="l00768" name="l00768"></a><span class="lineno">  768</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a93008a728ebb497723d93cf9cf4154b7">WB25Qxx_Exit_QPI</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00769" name="l00769"></a><span class="lineno">  769</span>{</div>
<div class="line"><a id="l00770" name="l00770"></a><span class="lineno">  770</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00771" name="l00771"></a><span class="lineno">  771</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#acc1238cefaf02261c21cb7d46dc32bd5">WB25Qxx_CMD_EXIT_QPI</a>, 8);</div>
<div class="line"><a id="l00772" name="l00772"></a><span class="lineno">  772</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00773" name="l00773"></a><span class="lineno">  773</span>}</div>
<div class="line"><a id="l00774" name="l00774"></a><span class="lineno">  774</span> </div>
<div class="line"><a id="l00781" name="l00781"></a><span class="lineno">  781</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="_s_p_i___w_b25_qxx_8c.html#a8fa23417edd7b0324ad2a7f77913ed3a">WB25Qxx_Set_QPI_Read_Param</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00782" name="l00782"></a><span class="lineno">  782</span>{</div>
<div class="line"><a id="l00783" name="l00783"></a><span class="lineno">  783</span>    uint8_t param = 0;</div>
<div class="line"><a id="l00784" name="l00784"></a><span class="lineno">  784</span> </div>
<div class="line"><a id="l00785" name="l00785"></a><span class="lineno">  785</span>    <span class="comment">/* p1 - p0 :</span></div>
<div class="line"><a id="l00786" name="l00786"></a><span class="lineno">  786</span><span class="comment">     * 00 = 8 byte</span></div>
<div class="line"><a id="l00787" name="l00787"></a><span class="lineno">  787</span><span class="comment">     * 01 = 16 byte</span></div>
<div class="line"><a id="l00788" name="l00788"></a><span class="lineno">  788</span><span class="comment">     * 10 = 32 byte</span></div>
<div class="line"><a id="l00789" name="l00789"></a><span class="lineno">  789</span><span class="comment">     * 11 = 64 byte</span></div>
<div class="line"><a id="l00790" name="l00790"></a><span class="lineno">  790</span><span class="comment">     */</span></div>
<div class="line"><a id="l00791" name="l00791"></a><span class="lineno">  791</span>    param |= (0 &lt;&lt; 1) | (0 &lt;&lt; 0);</div>
<div class="line"><a id="l00792" name="l00792"></a><span class="lineno">  792</span> </div>
<div class="line"><a id="l00793" name="l00793"></a><span class="lineno">  793</span>    <span class="comment">/* p5 - p4 :</span></div>
<div class="line"><a id="l00794" name="l00794"></a><span class="lineno">  794</span><span class="comment">     * 00 = 2 Dummy Clocks, Max Read Freq [33 MHz], only in A[1:0]=[0,0], VCC=3.0V ~ 3.6V Under condition Support [40 MHz]</span></div>
<div class="line"><a id="l00795" name="l00795"></a><span class="lineno">  795</span><span class="comment">     * 01 = 4 Dummy Clocks, Max Read Freq [55 MHz], only in A[1:0]=[0,0], VCC=3.0V ~ 3.6V Under condition Support [80 MHz]</span></div>
<div class="line"><a id="l00796" name="l00796"></a><span class="lineno">  796</span><span class="comment">     * 10 = 6 Dummy Clocks, Max Read Freq [80 MHz], only in A[1:0]=[0,0], VCC=3.0V ~ 3.6V Under condition Support [104 MHz]</span></div>
<div class="line"><a id="l00797" name="l00797"></a><span class="lineno">  797</span><span class="comment">     * 11 = 8 Dummy Clocks, Max Read Freq [80 MHz], only in A[1:0]=[0,0], VCC=3.0V ~ 3.6V Under condition Support [104 MHz]</span></div>
<div class="line"><a id="l00798" name="l00798"></a><span class="lineno">  798</span><span class="comment">     */</span></div>
<div class="line"><a id="l00799" name="l00799"></a><span class="lineno">  799</span>    param |= (0 &lt;&lt; 5) | (0 &lt;&lt; 4);</div>
<div class="line"><a id="l00800" name="l00800"></a><span class="lineno">  800</span> </div>
<div class="line"><a id="l00801" name="l00801"></a><span class="lineno">  801</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">spi_cs_low</a>();</div>
<div class="line"><a id="l00802" name="l00802"></a><span class="lineno">  802</span> </div>
<div class="line"><a id="l00803" name="l00803"></a><span class="lineno">  803</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(<a class="code hl_define" href="_s_p_i___w_b25_qxx_8c.html#a1b303c18ee9f1f7cced4ffae5815b1e6">WB25Qxx_CMD_SET_READ_PARAM</a>, 8);</div>
<div class="line"><a id="l00804" name="l00804"></a><span class="lineno">  804</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">qspi_write</a>(param, 8);</div>
<div class="line"><a id="l00805" name="l00805"></a><span class="lineno">  805</span> </div>
<div class="line"><a id="l00806" name="l00806"></a><span class="lineno">  806</span>    <a class="code hl_variable" href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a>.<a class="code hl_variable" href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">spi_cs_high</a>();</div>
<div class="line"><a id="l00807" name="l00807"></a><span class="lineno">  807</span>}</div>
<div class="line"><a id="l00808" name="l00808"></a><span class="lineno">  808</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="a_l_c_d___j_l_t35002_a_8c_html_a2c1496ee2cfbd6f432304250eeb36d65"><div class="ttname"><a href="_l_c_d___j_l_t35002_a_8c.html#a2c1496ee2cfbd6f432304250eeb36d65">spi_port_init</a></div><div class="ttdeci">static void spi_port_init(void)</div><div class="ttdef"><b>Definition:</b> <a href="_l_c_d___j_l_t35002_a_8c_source.html#l00164">LCD_JLT35002A.c:164</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a026120f0fec011e2c302b114b5961b55"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a026120f0fec011e2c302b114b5961b55">WB25Qxx_Read_Manufacturer_Device_ID</a></div><div class="ttdeci">uint16_t WB25Qxx_Read_Manufacturer_Device_ID(void)</div><div class="ttdoc">读取芯片厂商和设备 ID</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00218">SPI_WB25Qxx.c:218</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a0465c5f017965876cf6ff8859eb2731f"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a0465c5f017965876cf6ff8859eb2731f">WB25Qxx_Init</a></div><div class="ttdeci">void WB25Qxx_Init(void)</div><div class="ttdoc">初始化 WB25Qxx 使用的 SPI 接口, 并读取芯片 ID 等信息以判断其是否是 WB25Qxx 芯片</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00154">SPI_WB25Qxx.c:154</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a04c55a0ea26c3794552069171a06f868"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a04c55a0ea26c3794552069171a06f868">WB25Qxx_Enter_QPI</a></div><div class="ttdeci">static void WB25Qxx_Enter_QPI(void)</div><div class="ttdoc">进入 QPI 模式</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00752">SPI_WB25Qxx.c:752</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a1b303c18ee9f1f7cced4ffae5815b1e6"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a1b303c18ee9f1f7cced4ffae5815b1e6">WB25Qxx_CMD_SET_READ_PARAM</a></div><div class="ttdeci">#define WB25Qxx_CMD_SET_READ_PARAM</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00109">SPI_WB25Qxx.c:109</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a31f4382f10e496b80033a9550032fd1f"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a31f4382f10e496b80033a9550032fd1f">WB25Qxx_CheckTest</a></div><div class="ttdeci">uint8_t WB25Qxx_CheckTest(void)</div><div class="ttdoc">本驱动模块 WB25Qxx 各功能测试</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00505">SPI_WB25Qxx.c:505</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a36c6f79b3139b867813f1ee7f057b32b"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a36c6f79b3139b867813f1ee7f057b32b">DUMMY_CLOCK</a></div><div class="ttdeci">#define DUMMY_CLOCK</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00045">SPI_WB25Qxx.c:45</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a39809b92887312675a23a33bf9329fce"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce">WB25Qxx_IsBusy</a></div><div class="ttdeci">static uint8_t WB25Qxx_IsBusy(void)</div><div class="ttdoc">芯片忙检测(执行擦除、写入操作后需要执行忙检测以判断芯片是否已经完成操作)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00664">SPI_WB25Qxx.c:664</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a403c88531edb023065504eddcb22f4b3"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a403c88531edb023065504eddcb22f4b3">WB25Qxx_ReadStatus</a></div><div class="ttdeci">static uint32_t WB25Qxx_ReadStatus(void)</div><div class="ttdoc">读取芯片状态寄存器</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00613">SPI_WB25Qxx.c:613</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a4040c3c8299573cd8222219eef655c44"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a4040c3c8299573cd8222219eef655c44">WB25Qxx_CMD_PROGRAM_PAGE_QUAD</a></div><div class="ttdeci">#define WB25Qxx_CMD_PROGRAM_PAGE_QUAD</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00095">SPI_WB25Qxx.c:95</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a41f43e7631d713c3f96058444e57b90a"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a41f43e7631d713c3f96058444e57b90a">WB25Qxx_CMD_WRITE_STATUS_1</a></div><div class="ttdeci">#define WB25Qxx_CMD_WRITE_STATUS_1</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00071">SPI_WB25Qxx.c:71</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a4491f61ab80618ea07fcd79ebf46a38e"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a4491f61ab80618ea07fcd79ebf46a38e">WB25Qxx_CMD_READ_STATUS_1</a></div><div class="ttdeci">#define WB25Qxx_CMD_READ_STATUS_1</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00067">SPI_WB25Qxx.c:67</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a4ef715c150bf0527ee6a893fca31154a"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a4ef715c150bf0527ee6a893fca31154a">WB25Qxx_CMD_READ_CHIP_ID_QUAD</a></div><div class="ttdeci">#define WB25Qxx_CMD_READ_CHIP_ID_QUAD</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00062">SPI_WB25Qxx.c:62</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a65571e7929b299af3a763c206a2c98b5"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a65571e7929b299af3a763c206a2c98b5">WB25Qxx_EraseSector</a></div><div class="ttdeci">void WB25Qxx_EraseSector(uint32_t addr)</div><div class="ttdoc">擦除 WB25Qxx 指定扇区地址</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00291">SPI_WB25Qxx.c:291</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a6963996b0b5cfabd2f20a5c7ef915a6b"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a6963996b0b5cfabd2f20a5c7ef915a6b">WB25Qxx_MANUFACTOR_ID</a></div><div class="ttdeci">#define WB25Qxx_MANUFACTOR_ID</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00047">SPI_WB25Qxx.c:47</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a6af72df055a5bc71064719f68842f515"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a6af72df055a5bc71064719f68842f515">WB25Qxx_WritePage</a></div><div class="ttdeci">void WB25Qxx_WritePage(uint32_t addr, uint8_t *buff, uint32_t cnt)</div><div class="ttdoc">向 WB25Qxx 指定地址处写入指定个字节数据(写入前须保证待写入区域已被擦空)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00371">SPI_WB25Qxx.c:371</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a6c158a445050a00b631fd669de3213d7"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a6c158a445050a00b631fd669de3213d7">WB25Qxx_ReadData</a></div><div class="ttdeci">void WB25Qxx_ReadData(uint32_t addr, uint8_t *buff, uint32_t cnt)</div><div class="ttdoc">从 WB25Qxx 指定地址读取指定个字节数据</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00321">SPI_WB25Qxx.c:321</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a76dd4fc3eb8373980abf7a0a826a2171"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a76dd4fc3eb8373980abf7a0a826a2171">WB25Qxx_STATUS_WIP_Msk</a></div><div class="ttdeci">#define WB25Qxx_STATUS_WIP_Msk</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00076">SPI_WB25Qxx.c:76</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a7a17b081e5d51e64acc60324c53f2f3d"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a7a17b081e5d51e64acc60324c53f2f3d">WB25Qxx_CMD_ERASE_SECTOR_4KB</a></div><div class="ttdeci">#define WB25Qxx_CMD_ERASE_SECTOR_4KB</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00096">SPI_WB25Qxx.c:96</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a7a29a7c5cd84c833994d75370d0a8f02"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a7a29a7c5cd84c833994d75370d0a8f02">WB25Qxx_CMD_READ_JEDEC_ID</a></div><div class="ttdeci">#define WB25Qxx_CMD_READ_JEDEC_ID</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00064">SPI_WB25Qxx.c:64</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a898d70676b1ca77b7990d4b8d17b9e9b"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a898d70676b1ca77b7990d4b8d17b9e9b">WB25Qxx_DEVICE_ID</a></div><div class="ttdeci">#define WB25Qxx_DEVICE_ID</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00048">SPI_WB25Qxx.c:48</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a8ab716dbcb2ebbe5cbb92676585eb5bc"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a8ab716dbcb2ebbe5cbb92676585eb5bc">WB25Qxx_CMD_FAST_READ_DATA</a></div><div class="ttdeci">#define WB25Qxx_CMD_FAST_READ_DATA</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00089">SPI_WB25Qxx.c:89</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a8f90491088e0e7053d211def3f87a330"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a8f90491088e0e7053d211def3f87a330">WB25Qxx_Read_JEDEC_ID</a></div><div class="ttdeci">uint32_t WB25Qxx_Read_JEDEC_ID(void)</div><div class="ttdoc">读取芯片 JEDEC ID</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00259">SPI_WB25Qxx.c:259</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a8fa23417edd7b0324ad2a7f77913ed3a"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a8fa23417edd7b0324ad2a7f77913ed3a">WB25Qxx_Set_QPI_Read_Param</a></div><div class="ttdeci">static void WB25Qxx_Set_QPI_Read_Param(void)</div><div class="ttdoc">设置 QPI 模式下适应对最大读取频率或最小数据访问延迟的读等待周期.</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00775">SPI_WB25Qxx.c:775</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a93008a728ebb497723d93cf9cf4154b7"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a93008a728ebb497723d93cf9cf4154b7">WB25Qxx_Exit_QPI</a></div><div class="ttdeci">static void WB25Qxx_Exit_QPI(void)</div><div class="ttdoc">退出 QPI 模式(复位上电后默认为 Standard SPI 模式)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00762">SPI_WB25Qxx.c:762</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a9b4b5c3946502ca9fbf4d1259efbadcf"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a9b4b5c3946502ca9fbf4d1259efbadcf">WB25Qxx_CMD_FAST_READ_QUAD_IO</a></div><div class="ttdeci">#define WB25Qxx_CMD_FAST_READ_QUAD_IO</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00093">SPI_WB25Qxx.c:93</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a9b4d04305e7fab38b63926c818cfe608"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a9b4d04305e7fab38b63926c818cfe608">WB25Qxx_CMD_READ_STATUS_2</a></div><div class="ttdeci">#define WB25Qxx_CMD_READ_STATUS_2</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00068">SPI_WB25Qxx.c:68</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_a9e6f4f84a51a39e20eb657b21d2a46bc"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#a9e6f4f84a51a39e20eb657b21d2a46bc">Dev_SPI</a></div><div class="ttdeci">static const dev_spi_t Dev_SPI</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00139">SPI_WB25Qxx.c:139</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_aa38cc8ee8d4b1126001e721d05247bfe"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#aa38cc8ee8d4b1126001e721d05247bfe">WB25Qxx_STATUS_QE_Msk</a></div><div class="ttdeci">#define WB25Qxx_STATUS_QE_Msk</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00084">SPI_WB25Qxx.c:84</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_aaa52d63c064c0876bbbac9ea72274ba0"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#aaa52d63c064c0876bbbac9ea72274ba0">WB25Qxx_CMD_READ_CHIP_ID</a></div><div class="ttdeci">#define WB25Qxx_CMD_READ_CHIP_ID</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00060">SPI_WB25Qxx.c:60</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_ab1a5569183970e41016b5e01748bca43"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#ab1a5569183970e41016b5e01748bca43">WB25Qxx_JEDEC_ID</a></div><div class="ttdeci">#define WB25Qxx_JEDEC_ID</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00049">SPI_WB25Qxx.c:49</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_ab4d1b6dd306f907a5b365f7ff0a3d1e5"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#ab4d1b6dd306f907a5b365f7ff0a3d1e5">DST_NUM_BYTES</a></div><div class="ttdeci">#define DST_NUM_BYTES</div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_ab993cc2118e0aff734ed2d09a4bfc57f"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#ab993cc2118e0aff734ed2d09a4bfc57f">WB25Qxx_A_PAGE_BYTES</a></div><div class="ttdeci">#define WB25Qxx_A_PAGE_BYTES</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00046">SPI_WB25Qxx.c:46</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_abe79ac77afe147dccaf2977f796329ad"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#abe79ac77afe147dccaf2977f796329ad">WB25Qxx_Write_QE</a></div><div class="ttdeci">static void WB25Qxx_Write_QE(void)</div><div class="ttdoc">设置 QE 位, 使能 Quad_SPI / QPI 操作模式(对于 QPI 模式则必须在 Enter QPI (38h) 之前设置)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00739">SPI_WB25Qxx.c:739</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_ac09f7d91a3a83bb1b6a993dbab130583"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#ac09f7d91a3a83bb1b6a993dbab130583">WB25Qxx_CMD_WRITE_ENABLE</a></div><div class="ttdeci">#define WB25Qxx_CMD_WRITE_ENABLE</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00101">SPI_WB25Qxx.c:101</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_acc1238cefaf02261c21cb7d46dc32bd5"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#acc1238cefaf02261c21cb7d46dc32bd5">WB25Qxx_CMD_EXIT_QPI</a></div><div class="ttdeci">#define WB25Qxx_CMD_EXIT_QPI</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00108">SPI_WB25Qxx.c:108</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_add8e47c7436ee8158d45cc2a9d34999b"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#add8e47c7436ee8158d45cc2a9d34999b">WB25Qxx_CMD_PROGRAM_PAGE</a></div><div class="ttdeci">#define WB25Qxx_CMD_PROGRAM_PAGE</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00094">SPI_WB25Qxx.c:94</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_ae31db601e8f25e65389adda808c61e8d"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#ae31db601e8f25e65389adda808c61e8d">WB25Qxx_Write_Enable</a></div><div class="ttdeci">static void WB25Qxx_Write_Enable(void)</div><div class="ttdoc">设置 WEL 位, 使能写入(必须在每个擦除、写入状态寄存器和擦除/编程安全寄存器指令之前设置)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00672">SPI_WB25Qxx.c:672</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_aea78bd0b9d68918932cd4055777317c3"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#aea78bd0b9d68918932cd4055777317c3">WB25Qxx_WriteStatus</a></div><div class="ttdeci">static void WB25Qxx_WriteStatus(uint32_t register_status)</div><div class="ttdoc">写入芯片状态寄存器</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00690">SPI_WB25Qxx.c:690</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_aee6643c146233d7cacb6ade01f6f7761"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#aee6643c146233d7cacb6ade01f6f7761">WB25Qxx_CMD_WRITE_STATUS_2</a></div><div class="ttdeci">#define WB25Qxx_CMD_WRITE_STATUS_2</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00072">SPI_WB25Qxx.c:72</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_af202e311e227e572f6a06817e6624ec6"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#af202e311e227e572f6a06817e6624ec6">WB25Qxx_CMD_ENTER_QPI</a></div><div class="ttdeci">#define WB25Qxx_CMD_ENTER_QPI</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00107">SPI_WB25Qxx.c:107</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_af3283a1cc275bb536b31ab945449b40c"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#af3283a1cc275bb536b31ab945449b40c">WB25Qxx_WriteBuff</a></div><div class="ttdeci">void WB25Qxx_WriteBuff(uint32_t addr, uint8_t *buff, uint32_t cnt)</div><div class="ttdoc">向 WB25Qxx 指定地址处写入指定个字节数据(写入前须保证待写入区域已被擦空)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00419">SPI_WB25Qxx.c:419</a></div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8c_html_afae12ac043a663635a5132cffa62458b"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8c.html#afae12ac043a663635a5132cffa62458b">DST_ADDR</a></div><div class="ttdeci">#define DST_ADDR</div></div>
<div class="ttc" id="a_s_p_i___w_b25_qxx_8h_html"><div class="ttname"><a href="_s_p_i___w_b25_qxx_8h.html">SPI_WB25Qxx.h</a></div><div class="ttdoc">WB25Qxx SPI Flash 驱动程序</div></div>
<div class="ttc" id="adev__io__spi_8c_html_a16d2dfe6a5c03f49b9584239472f5c41"><div class="ttname"><a href="dev__io__spi_8c.html#a16d2dfe6a5c03f49b9584239472f5c41">IO_SPI_CS_LOW</a></div><div class="ttdeci">void IO_SPI_CS_LOW(void)</div><div class="ttdoc">IO 模拟 SPI 通讯的 CS 拉低</div><div class="ttdef"><b>Definition:</b> <a href="dev__io__spi_8c_source.html#l00136">dev_io_spi.c:136</a></div></div>
<div class="ttc" id="adev__io__spi_8c_html_a4b9736b990d7b5ce371509d7edd35a70"><div class="ttname"><a href="dev__io__spi_8c.html#a4b9736b990d7b5ce371509d7edd35a70">io_qspi_read</a></div><div class="ttdeci">uint32_t io_qspi_read(uint32_t bit_len)</div><div class="ttdoc">IO 模拟 QSPI 通讯读</div><div class="ttdef"><b>Definition:</b> <a href="dev__io__spi_8c_source.html#l00285">dev_io_spi.c:285</a></div></div>
<div class="ttc" id="adev__io__spi_8c_html_a97e76f9e7d5b3673003b3062b0982abb"><div class="ttname"><a href="dev__io__spi_8c.html#a97e76f9e7d5b3673003b3062b0982abb">IO_SPI_CS_HIGH</a></div><div class="ttdeci">void IO_SPI_CS_HIGH(void)</div><div class="ttdoc">IO 模拟 SPI 通讯的 CS 拉高</div><div class="ttdef"><b>Definition:</b> <a href="dev__io__spi_8c_source.html#l00144">dev_io_spi.c:144</a></div></div>
<div class="ttc" id="adev__io__spi_8c_html_acbe161ab6562f9da568695c02f71d18e"><div class="ttname"><a href="dev__io__spi_8c.html#acbe161ab6562f9da568695c02f71d18e">io_qspi_write</a></div><div class="ttdeci">void io_qspi_write(uint32_t data, uint32_t bit_len)</div><div class="ttdoc">IO 模拟 QSPI 通讯写</div><div class="ttdef"><b>Definition:</b> <a href="dev__io__spi_8c_source.html#l00228">dev_io_spi.c:228</a></div></div>
<div class="ttc" id="adev__io__spi_8c_html_adb59768338d754f15de5d09e175fb3b8"><div class="ttname"><a href="dev__io__spi_8c.html#adb59768338d754f15de5d09e175fb3b8">io_spi_readwrite</a></div><div class="ttdeci">uint32_t io_spi_readwrite(uint32_t data, uint32_t bit_len)</div><div class="ttdoc">IO 模拟标准 SPI 通讯读写</div><div class="ttdef"><b>Definition:</b> <a href="dev__io__spi_8c_source.html#l00178">dev_io_spi.c:178</a></div></div>
<div class="ttc" id="adev__io__spi_8c_html_ae5dc9bbf8a794391f1183411c047dfa2"><div class="ttname"><a href="dev__io__spi_8c.html#ae5dc9bbf8a794391f1183411c047dfa2">io_spi_init</a></div><div class="ttdeci">void io_spi_init(void)</div><div class="ttdoc">IO 模拟 SPI 通讯端口初始化</div><div class="ttdef"><b>Definition:</b> <a href="dev__io__spi_8c_source.html#l00152">dev_io_spi.c:152</a></div></div>
<div class="ttc" id="adev__io__spi_8h_html"><div class="ttname"><a href="dev__io__spi_8h.html">dev_io_spi.h</a></div><div class="ttdoc">IO 模拟 SPI 通讯接口</div></div>
<div class="ttc" id="adev__sfc_8c_html_aad5d116153c77313a1212733b556a578"><div class="ttname"><a href="dev__sfc_8c.html#aad5d116153c77313a1212733b556a578">sfc_init</a></div><div class="ttdeci">void sfc_init(void)</div><div class="ttdoc">初始化 SFC 将 外挂的SPI-Flash 映射至 MCU 总线地址上</div><div class="ttdef"><b>Definition:</b> <a href="dev__sfc_8c_source.html#l00102">dev_sfc.c:102</a></div></div>
<div class="ttc" id="adev__sfc_8h_html"><div class="ttname"><a href="dev__sfc_8h.html">dev_sfc.h</a></div><div class="ttdoc">SPI-Flash Control 硬件专用高速模块</div></div>
<div class="ttc" id="astructdev__spi__t_html"><div class="ttname"><a href="structdev__spi__t.html">dev_spi_t</a></div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00129">SPI_WB25Qxx.c:130</a></div></div>
<div class="ttc" id="astructdev__spi__t_html_a2ab2982d4778600f47ed1e77c43bfca5"><div class="ttname"><a href="structdev__spi__t.html#a2ab2982d4778600f47ed1e77c43bfca5">dev_spi_t::spi_cs_high</a></div><div class="ttdeci">void(* spi_cs_high)(void)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00133">SPI_WB25Qxx.c:133</a></div></div>
<div class="ttc" id="astructdev__spi__t_html_a41ccd96d33be9001e78b01225c198ee8"><div class="ttname"><a href="structdev__spi__t.html#a41ccd96d33be9001e78b01225c198ee8">dev_spi_t::qspi_read</a></div><div class="ttdeci">uint32_t(* qspi_read)(uint32_t bit_len)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00136">SPI_WB25Qxx.c:136</a></div></div>
<div class="ttc" id="astructdev__spi__t_html_a50512badda26c7e4175fa07c72c497c3"><div class="ttname"><a href="structdev__spi__t.html#a50512badda26c7e4175fa07c72c497c3">dev_spi_t::spi_cs_low</a></div><div class="ttdeci">void(* spi_cs_low)(void)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00132">SPI_WB25Qxx.c:132</a></div></div>
<div class="ttc" id="astructdev__spi__t_html_a719005b63495ad9f6c14c03bffb4c8f4"><div class="ttname"><a href="structdev__spi__t.html#a719005b63495ad9f6c14c03bffb4c8f4">dev_spi_t::spi_port_init</a></div><div class="ttdeci">void(* spi_port_init)(void)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00131">SPI_WB25Qxx.c:131</a></div></div>
<div class="ttc" id="astructdev__spi__t_html_af036d33364f6434c88085f540704eac7"><div class="ttname"><a href="structdev__spi__t.html#af036d33364f6434c88085f540704eac7">dev_spi_t::qspi_write</a></div><div class="ttdeci">void(* qspi_write)(uint32_t data, uint32_t bit_len)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00135">SPI_WB25Qxx.c:135</a></div></div>
<div class="ttc" id="astructdev__spi__t_html_afe17891504d5dd7d89ed2addade7976e"><div class="ttname"><a href="structdev__spi__t.html#afe17891504d5dd7d89ed2addade7976e">dev_spi_t::spi_readwrite</a></div><div class="ttdeci">uint32_t(* spi_readwrite)(uint32_t data, uint32_t bit_len)</div><div class="ttdef"><b>Definition:</b> <a href="_s_p_i___w_b25_qxx_8c_source.html#l00134">SPI_WB25Qxx.c:134</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
